<?php


namespace app\admin\middleware;

use app\admin\service\Auth;
use DI\Annotation\Inject;
use Webman\MiddlewareInterface;
use Webman\Http\Response;

class AuthInit implements MiddlewareInterface
{
    /**
     * @var Auth
     * @Inject()
     */
    protected $service = null;

    public function process($request, callable $next): Response
    {
        $this->service->init();
        return $next($request);
    }
}
